package com.skyworth.web.menu;

import com.skyworth.web.admin.menu.domain.MenuModel;
import com.skyworth.web.admin.menu.service.MenuService;
import com.skyworth.web.common.controller.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * Created by skyworth on 2016/8/8.
 */
@Controller
public class ApiMenuController extends BaseController {

	Logger LOG = LoggerFactory.getLogger(ApiMenuController.class);

	@Autowired
	private MenuService menuService;

	@ResponseBody
	@RequestMapping(value="/api/getmenu/category/{categoryId}",method = RequestMethod.GET)
	public Iterable<MenuModel> getMenuByCategoryId(@PathVariable("categoryId") long categoryId){
		return menuService.getByCategoryId(categoryId);
	}

}
